From: Jonas Dreßler Date: Mon, 9 Sep 2019 15:08:53 +0000 (+0200) Subject: extensionPrefs: Block notify::active signal handler while updating state X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~153 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1e68e78d8e5755b48f6ab1c2032ea45920f00737;p=gnome-shell.git extensionPrefs: Block notify::active signal handler while updating state We disable and enable extensions inside the `notify::active` signal handler, but we shouldn't do that in case the change didn't come from the user but because something else changed the state of the extension. This causes an issue when the extensionPrefs window is open and the session gets locked: The extensions are temporarily disabled by the shell, extensionPrefs updates its switches on the state change and adds those extensions to the `disabled-extensions` gsettings key inside the signal handler. Now when the session is unlocked again, the extensions won't be enabled again since they're forced-disabled. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/705 --- diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index 1a0783bdd..552360080 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -578,7 +578,11 @@ class ExtensionRow extends Gtk.ListBoxRow { this._extension = ExtensionUtils.deserializeExtension(newState); let state = (this._extension.state == ExtensionState.ENABLED); + + GObject.signal_handler_block(this._switch, this._notifyActiveId); this._switch.state = state; + GObject.signal_handler_unblock(this._switch, this._notifyActiveId); + this._switch.sensitive = this._canToggle(); }); } @@ -646,7 +650,7 @@ class ExtensionRow extends Gtk.ListBoxRow { sensitive: this._canToggle(), state: this._extension.state === ExtensionState.ENABLED }); - this._switch.connect('notify::active', () => { + this._notifyActiveId = this._switch.connect('notify::active', () => { if (this._switch.active) this._app.shellProxy.EnableExtensionRemote(this.uuid); else